package com.fc.mall.portal.controller;

import com.fc.mall.base.object.Result;
import com.fc.mall.model.UmsMemberBank;
import com.fc.mall.portal.service.UmsMemberBankService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * Created by Sunny on 2019/7/4.
 */
@RestController
@RequestMapping("/member/bank")
public class UmsMemberBankController {

    @Autowired
    private UmsMemberBankService memberBankService;


    @ApiOperation("绑定银行卡")
    @PostMapping("bind/card")
    public Result bindBankCard(@RequestBody UmsMemberBank memberBank)
    {
        memberBankService.saveOrUpdateCardInfo(memberBank);
        return Result.success();
    }
    @ApiOperation("获取银行卡")
    @GetMapping("bind/card")
    public Result getBankInfo()
    {
        return Result.success(memberBankService.getMemberBank());
    }


}
